<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div ng-app="myApp">
    <div ng-controller="firstController">
        <!--limitTo 截取前3位-->
        <!--[1,2,3]-->
        <p>{{ [1,2,3,4,5,6,7] | limitTo:3}}</p>

        <!--limitTo 从后截取3位-->
        <!--[5,6,7]-->
        <p>{{ [1,2,3,4,5,6,7] | limitTo:-3}}</p>

        <!--chinese-->
        <p>{{ Data.language | lowercase }}</p>

        <!--CHINESE-->
        <p>{{ Data.language | uppercase }}</p>

        <!--[{"name":"上海","py":"shanghai"},{"name":"北京","py":"beijing"},{"name":"东京","py":"dongjing"}]-->
        <!--jsonz字符串-->
        <p>{{ Data.cities }}</p>

        <!--过滤-->
        <!--对所有value进行搜索，模糊匹配-->
        <!--[{"name":"上海","py":"shanghai"}]-->
        <p>{{Data.cities | filter : '上海' }}</p>

        <!--key值搜索不到的-->
        <!--[]-->
        <p>{{Data.cities | filter : 'name' }}</p>

        <!--[{"name":"北京","py":"beijing"},{"name":"东京","py":"dongjing"}]-->
        <p>{{Data.cities | filter : {py : 'in'} }}</p>

        <!--排序-->
        <!--默认顺序是升序 asc-->
        <!--[{"name":"北京","py":"beijing"},{"name":"东京","py":"dongjing"},{"name":"上海","py":"shanghai"}]-->
        <p>{{Data.cities | orderBy : 'py' }}</p>

        <!--降序 desc-->
        <!--[{"name":"上海","py":"shanghai"},{"name":"东京","py":"dongjing"},{"name":"北京","py":"beijing"}]-->
        <p>{{Data.cities | orderBy : '-py' }}</p>

        <!--json：可以将一个对象或者数组等等格式化成一个json格式，然后主要用来给我们做调试用的。因为它有一定格式-->

        <!--filter还可以用于自定义方法-->
        <!--会调用checkName函数，把过滤的对象传回来-->
        <p>{{ Data.cities | filter : checkName}}</p>
    </div>

</div>


<script src="../../vendor/angular/angularjs.js" type="text/javascript"></script>
<script type="text/javascript" src="app/index.js"></script>
</body>
</html>